Ext.define('SKJF.view.AKSES.v_s_users', {
	extend: 'Ext.grid.Panel',
	requires: ['SKJF.store.s_s_users'],
	
	title		: 's_users',
	itemId		: 'Lists_users',
	alias       : 'widget.Lists_users',
	store 		: 's_s_users',
	columnLines : true,
	frame		: false,
	
	margin		: 0,
	selectedIndex : -1,
	
	initComponent: function(){
		var me = this;
		var docktool = Ext.create('Ext.toolbar.Paging', {
			store: 's_s_users',
			dock: 'bottom',
			displayInfo: true
		});		
		this.columns = [
			{
				header: 'USER ID',
				dataIndex: 'USER_ID'
			},{
				header: 'USERNAME',
				dataIndex: 'USER_NAME'
			},{
				header: 'PASSWORD',
				dataIndex: 'USER_PASSWD',
				renderer : function(val,metadata,record) {
					return '<span style="color:red;">[hidden]</span>';
				}
			}];
		this.dockedItems = [docktool];
		
		this.callParent(arguments);
		
		this.on('itemclick', this.gridSelection);
		this.getView().on('refresh', this.refreshSelection, this);
	},	
	
	gridSelection: function(me, record, item, index, e, eOpts){
		//me.getSelectionModel().select(index);
		this.selectedIndex = index;
		this.getView().saveScrollState();
	},
	
	refreshSelection: function() {
        this.getSelectionModel().select(this.selectedIndex);   /*Ext.defer(this.setScrollTop, 30, this, [this.getView().scrollState.top]);*/
    }

});